<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // forEach() 遍历 为每个数组元素调用函数
    {
        console.log("*************forEach********************");
        let checkList = [true, false, true, false]
        checkList.forEach(item => {
            item = false
        })
        console.log(checkList);

    }

    {
        console.log("*************forEach********************");
        let arr = [{ a: 10 }, { a: 100 }]
        arr.forEach(item => {
            item.a = 99
        })
        console.log(arr);

    }


    // map()  遍历  使用为每个数组元素调用函数的结果创建新数组,返回新数组
</script>

</html>